home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 46 / Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso / -serious- / programming / other / tandem / teaching / 44.asm < prev    next >
Assembly Source File  |  1999-09-06  |  2KB  |  61 lines

  1. * 44.asm  TLmultiline     version 0.01     8.6.99
  2.  
  3.  
  4.  include 'Front.i'         ;*** change to 'Tandem.i' to step thru TL's ***
  5.  
  6.  
  7. ; TLmultiline is a very large and complex program. It allows the user to
  8. ; co-opt a window temporarily to display a set of lines, and perhaps to
  9. ; edit them. It is a full-blown text editor in its own right. TLmultiline
  10. ; also has its own Amiga.guide which the user of TMmultiline can peruse.
  11. ; The version of TLmultiline in release 1 of tandem.library is crippled, as
  12. ; it only edits plaintext, without character & line styling or graphics.
  13.  
  14. ; TLmultiline when it takes over a window remembers its attributes, and
  15. ; restores those attributes to its host window when it exits. The program
  16. ; below demonstrates this.
  17.  
  18. ; TLmultiline has extensive built-in online help.
  19.  
  20.  
  21. strings: dc.b 0
  22.  dc.b 'TLMultiline demonstration',0 ;1
  23.  dc.b 'Done!!',0 ;2
  24. st_3: dc.b 'a TLMultiline window!',0 ;3
  25.  dc.b 'This window will become a TLmultiline window.',0 ;4
  26.  dc.b 'TLmultiline is a built-in text editor.',0 ;5
  27.  dc.b 'There is context sensitive help, via the',0 ;6
  28.  dc.b '<Help> key, and it also has its own menu.',0 ;7
  29.  
  30.  ds.w 0
  31.  
  32.  
  33. menu:
  34.  TLnm 1,13
  35.  TLnm 2,14
  36.  TLnm 2,-1
  37.  TLnm 2,15
  38.  TLnm 4,0
  39.  
  40.  
  41. * demonstrate TLMultiline
  42. Program:
  43.  TLwindow #0,#0,#0,#380,#120,#640,#256,#-1,#st_3 ;open window 0
  44.  beq Pr_quit
  45.  
  46.  TLreqinfo #4,#4,#0        ;show preliminary info
  47.  beq.s Pr_quit             ;quit if can't
  48.  move.l xxp_AcWind(a4),a5       ;point to current window
  49.  move.w #76,xxp_Mmxc(a5)        ;max 76 chrs/line    } override defaults
  50.  move.l #1000000,xxp_Mmsz(a5)   ;mem size 1000000    } before calling
  51.  
  52. Pr_mult:
  53.  TLmultiline #xxp_xmsty,#xxp_xesty ;* run TLMultiline (all styl forbidden)
  54.  tst.l xxp_errn(a4)
  55.  bne.s Pr_quit             ;quit if error
  56.  cmp.b #$97,xxp_kybd+3(a4) ;redo if merely stopped because inactive window
  57.  beq Pr_mult
  58.  
  59. Pr_quit:
  60.  rts
  61.